﻿using System;
using System.Windows.Forms;
using YonYou.U8.IN.Framework;
using YonYou.U8.IN.Model;

namespace YonYou.U8.IN.DataCheck
{
    public class NetControl : INetControl
    {
        public bool ShowStatusBar
        {
            get
            {
                return false;
            }
        }

        public Control CreateControl(BizContext context)
        {
            LoginEntity loginEntity = new LoginEntity(context.LoginObject);
            //Common.ConnString = loginEntity.UserData.ConnString.Replace("PROVIDER=SQLOLEDB;", "");
            //Common.login = new UFSoft.U8.Framework.Login.UI.clsLogin();
            //Common.login.LanguageID = "zh-cn";
            //if (!Common.login.login("QI", loginEntity.UserData.UserId, loginEntity.UserData.Password, loginEntity.UserData.AppServer, loginEntity.UserData.operDate, loginEntity.UserData.DataSource, loginEntity.UserData.WorkStationSerial))
            //{
            //    MessageBox.Show("登录数据检查失败");
            //    return null;
            //}
            //Common.VBlogin = new clsLoginClass();
            //Common.VBlogin.ConstructLogin(Common.login.userToken);
            string pSubId = "QI";
            string pAccId = null;
            string pYearId = null;
            string pUserId = null;
            string pPassword = null;
            string pDate = null;
            string cSrv = null;
            string cSerial = null;
            //Common.VBlogin.Login(ref pSubId, ref pAccId, ref pYearId, ref pUserId, ref pPassword, ref pDate, ref cSrv, ref cSerial);
            //Common.loginDate = Convert.ToDateTime(Common.login.GetLoginInfo().operDate).ToString("yyyyMMdd");
            //Common.context = context;
            //Common.DataCheckTemplateAdminConfig = "<?xml version='1.0' encoding='utf-8' ?>\r\n                            <Config>\r\n                              <Partion><![CDATA[U8:\\数据检查]]></Partion>\r\n                              <Permissions>\r\n                                <Permission authority='Delete' to='QI260403' />\r\n                                <Permission authority='Upload' to='QI260401' />\r\n                                <Permission authority='Download' to='QI260402' />\r\n\t                            <Permission authority='Rename' to='QI260403' />\r\n\t                            <Permission authority='New' to='QI260401' />\r\n                              </Permissions>\r\n                              <Plugins>\r\n                              </Plugins>\r\n                            </Config>";
            return new MainForm();
        }
    }

}